package com.njuse.jvmfinal.runtimestructure;
import com.njuse.jvmfinal.memory.jclass.JClass;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Jarray {
	
int length;
int flag=0;
JClass component;
Object[] jarray;
JClass clazz;

public Jarray(Jlink link,int flag,JClass component,JClass clazz) {
	this.length=link.getNumber();
	this.flag=flag;
	this.component=component;
	this.clazz=clazz;
	this.jarray=new Object[length];
	if (flag==0) {
	  if (component.isIsarray()!=true) {
	    for (int i=0;i<this.length;i++) {
		    this.jarray[i]=new Jobject(component);
	    }
	  }else {
	    for (int i=0;i<this.length;i++) {
	  	  this.jarray[i]=component.getinstance(link.getNext());
	    }
	  }
	}
}


}
